import { Http } from '@/utils/Http.js'

export const ShoppingCartApi = {

	/**
	 * 添加购物车
	 * @returns
	 */
	add: (param) => {
		return Http.request({
			url: '/app/food/shoppingCart/add',
			method: 'post',
			data: param
		})
	},

	/**
	 * 修改地址
	 * @returns
	 */
	minus: (id) => {
		return Http.request({
			url: '/app/food/shoppingCart/minus',
			method: 'get',
			data: {id:id}
		})
	},

	/**
	 * 添加数量
	 * @returns
	 */
	plus: (id) => {
		return Http.request({
			url: '/app/food/shoppingCart/plus',
			method: 'get',
			data: {id:id}
		})
	},

	/**
	 * 查询列表
	 * @returns
	 */
	getList: (param) => {
		return Http.request({
			url: '/app/food/shoppingCart/getList',
			method: 'get',
			data: param
		})
	},

	/**
	 * 查询列表
	 * @returns
	 */
	getListByIds: (param) => {
		return Http.request({
			url: '/app/food/shoppingCart/getListByIds',
			method: 'post',
			data: param
		})
	},

	/**
	 * 查询列表
	 * @returns
	 */
	clearShoppingCart: (param) => {
		return Http.request({
			url: '/app/food/shoppingCart/clearShoppingCart',
			method: 'get',
			data: param
		})
	},

	/**
	 * 删除购物车
	 * @returns
	 */
	delCart: (param) => {
		return Http.request({
			url: '/app/food/shoppingCart/delCart',
			method: 'get',
			data: param
		})
	},

	/**
	 * 批量删除购物车
	 * @returns
	 */
	delCartByIds: (ids) => {
		return Http.request({
			url: '/app/food/shoppingCart/delCartByIds',
			method: 'post',
			data: ids
		})
	},

	/**
	 * 获取购物车数量
	 * @returns
	 */
	countShoppingCart: (param) => {
		return Http.request({
			url: '/app/food/shoppingCart/countShoppingCart',
			method: 'get',
			data: param
		})
	},

}
